package com.ruoyi.buy.service.impl;

import com.ruoyi.buy.domain.entity.PO.BuyRequestbuyBillItem;
import com.ruoyi.buy.mapper.PO.BuyRequestbuyBillItemMapper;
import com.ruoyi.buy.service.IBuyRequestbuyBillItemService;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 请购单明细Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-06-13
 */
@Service
public class BuyRequestbuyBillItemServiceImpl implements IBuyRequestbuyBillItemService
{
    @Autowired
    private BuyRequestbuyBillItemMapper buyRequestbuyBillItemMapper;

    /**
     * 查询请购单明细
     * 
     * @param id 请购单明细主键
     * @return 请购单明细
     */
    @Override
    public BuyRequestbuyBillItem selectBuyRequestbuyBillItemById(Long id)
    {
        return buyRequestbuyBillItemMapper.selectBuyRequestbuyBillItemById(id);
    }

    /**
     * 查询请购单明细列表
     * 
     * @param buyRequestbuyBillItem 请购单明细
     * @return 请购单明细
     */
    @Override
    public List<BuyRequestbuyBillItem> selectBuyRequestbuyBillItemList(BuyRequestbuyBillItem buyRequestbuyBillItem)
    {
        return buyRequestbuyBillItemMapper.selectBuyRequestbuyBillItemList(buyRequestbuyBillItem);
    }

    /**
     * 新增请购单明细
     * 
     * @param buyRequestbuyBillItem 请购单明细
     * @return 结果
     */
    @Override
    public int insertBuyRequestbuyBillItem(BuyRequestbuyBillItem buyRequestbuyBillItem)
    {
        buyRequestbuyBillItem.setCreateTime(DateUtils.getNowDate());
        return buyRequestbuyBillItemMapper.insertBuyRequestbuyBillItem(buyRequestbuyBillItem);
    }

    /**
     * 修改请购单明细
     * 
     * @param buyRequestbuyBillItem 请购单明细
     * @return 结果
     */
    @Override
    public int updateBuyRequestbuyBillItem(BuyRequestbuyBillItem buyRequestbuyBillItem)
    {
        buyRequestbuyBillItem.setUpdateTime(DateUtils.getNowDate());
        return buyRequestbuyBillItemMapper.updateBuyRequestbuyBillItem(buyRequestbuyBillItem);
    }

    /**
     * 批量删除请购单明细
     * 
     * @param ids 需要删除的请购单明细主键
     * @return 结果
     */
    @Override
    public int deleteBuyRequestbuyBillItemByIds(Long[] ids)
    {
        return buyRequestbuyBillItemMapper.deleteBuyRequestbuyBillItemByIds(ids);
    }

    /**
     * 删除请购单明细信息
     * 
     * @param id 请购单明细主键
     * @return 结果
     */
    @Override
    public int deleteBuyRequestbuyBillItemById(Long id)
    {
        return buyRequestbuyBillItemMapper.deleteBuyRequestbuyBillItemById(id);
    }
}
